﻿
Imports System.IO
Imports std
Imports xmlctrl

Public Class xml
    Inherits xmldefinition

    Public Sub New(Optional ByVal buff As Stream = Nothing)
        MyBase.New(buff, "xml")
    End Sub

    Public Property version() As String
        Get
            Return attribute("version")
        End Get
        Set(ByVal value As String)
            attribute("version") = value
        End Set
    End Property

    Public Property encoding() As String
        Get
            Return attribute("encoding")
        End Get
        Set(ByVal value As String)
            attribute("encoding") = value
        End Set
    End Property

    Protected Overrides Function renderAttributes(ByVal compress As Boolean) As Boolean
        Return renderAttributesImpl(compress, "version", "encoding")
    End Function

    Public Shared Sub unittest()
        Dim inst As xml = Nothing
        inst = New xml()
        'inst.setWriter(Console.Out)
        inst.version = 1.1
        inst.encoding = Global.encoding.name.utf8
        'assert(inst.render())
        Console.WriteLine(inst.ToString())
    End Sub

End Class
